import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'room_page_tag_inherited.dart';

mixin StatelessControllerMixin<T extends GetxController> on StatelessWidget {
  /// 通过 BuildContext 获取控制器
  T getRoomController(BuildContext context) {
    final tag = RoomPageTagInheritedWidget.of(context)?.tag;
    assert(tag != null, 'PageTagInherited not found in context');
    return Get.find<T>(tag: tag!);
  }
}